#include "mylineedit.h"
#include <QDebug>
#include <QKeyEvent>

MyLineEdit::MyLineEdit(QWidget* parent) : QLineEdit(parent)
{

}

void MyLineEdit::keyPressEvent(QKeyEvent *event)
{
    qDebug() << "文本框有输入";
    QLineEdit::keyPressEvent(event); // 务必要调用父类的默认事件处理函数
    event->setAccepted(false); // 往父部件传递事件
}
